﻿/**************************************************************************************
 * KillPlugin
 * Deletes a plugin from the Dynamics CRM database
 *
 * @copyright    Copyright (c) 2013, CRM Accelerators (http://www.crmaccelerators.net)
 * @license      Microsoft Public License (Ms-PL)
 * @developer    Mitch Milam (http://blogs.infinite-x.net)
 * @version      1.0
 *
 * THIS SOFTWARE IS PROVIDED BY CRM Accelerators ''AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL CRM Accelerators BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 **************************************************************************************/

using CommandLine;
using CommandLine.Text;

namespace KillPlugin
{
    class CommandLineOptions
    {
        [Option('v', "verbose", DefaultValue = true, HelpText = "Prints all messages to standard output.")]
        public bool Verbose { get; set; }

        [Option('u', "URL", Required = true, HelpText = "URL to CRM server. Example: http://crm2011/contoso")]
        public string CrmServerUrl { get; set; }

        [Option('n', "username", Required = false, HelpText = "User name")]
        public string UserName { get; set; }

        [Option('p', "password", Required = false, HelpText = "Password.")]
        public string Password { get; set; }

        [Option('d', "domain", Required = false, HelpText = "Domain name")]
        public string DomainName { get; set; }

        [Option('l', "pluginname", Required = true, HelpText = "Plugin Name")]
        public string PluginName { get; set; }

        [ParserState]
        public IParserState LastParserState { get; set; }

        [HelpOption]
        public string GetUsage()
        {
            return HelpText.AutoBuild(this,
              (HelpText current) => HelpText.DefaultParsingErrorsHandler(this, current));
        }
    }

}
